package tsinghua.smxq.ui;

import tsinghua.smxq.mc.R;
import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;

public class MCMenuAdapter extends BaseAdapter {
	public static int[] ICONS = { R.drawable.menu_back, R.drawable.menu_bus,
			R.drawable.menu_foodprice, R.drawable.menu_weather,
			R.drawable.menu_map, R.drawable.menu_stocks, R.drawable.menu_utils };
	public Activity context;
	public int[] listItems;
	public static int currPosition;
	public int position;

	public MCMenuAdapter(Activity context) {
		this.context = context;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return ICONS.length;
	}

	@Override
	public Object getItem(int arg0) {
		// TODO Auto-generated method stub
		return arg0;
	}

	@Override
	public long getItemId(int arg0) {
		// TODO Auto-generated method stub
		return arg0;
	}

	@Override
	public View getView(int arg0, View convertView, ViewGroup arg2) {
		// TODO Auto-generated method stub
		LayoutInflater inflater = LayoutInflater.from(context);
		convertView = inflater.inflate(R.layout.menu_item, null);
		ImageView iv = (ImageView) convertView.findViewById(R.id.iv_Item);
		iv.setImageDrawable(context.getResources().getDrawable(ICONS[arg0]));
		return convertView;
	}
}
